import { createRouter, createWebHistory } from 'vue-router'
import Login from '../components/Login.vue'
import Home from '../components/Home.vue'
import AdminDashboard from '../components/AdminDashboard.vue'
import Profile from '../components/Profile.vue'
import BlogDetail from '../components/BlogDetail.vue'
import Activities from '../components/Activities.vue'
import Register from '../components/Register.vue';
import CreateEditPost from '../components/CreateEditPost.vue';
import StarBlog from '../components/StarBlog.vue';
import AddBlog from '../components/AddBlog.vue';
const routes = [
  { path: '/', name: 'Login', component: Login },
  { path: '/home', name: 'Home', component: Home },
  { path: '/admin', name: 'AdminDashboard', component: AdminDashboard },
  { 
    path: '/profile', 
    name: 'Profile', 
    component: Profile 
  },
  { 
    path: '/blog/:id', 
    name: 'BlogDetail', 
    component: BlogDetail 
  },
  { 
    path: '/activities',
     name: 'Activities', 
     component: Activities 
    },
  {
    path: '/register', 
    name: 'Register',
    component: Register, 
  },
  {
    path: '/post/create',
    name: 'CreatePost',
    component: CreateEditPost,
  },
  {
    path: '/post/edit/:id',
    name: 'EditPost',
    component: CreateEditPost,
  },
  { path: '/', component: Home },
  { path: '/star-blog', component: StarBlog },
  { path: '/blog/:id', component: BlogDetail },
  { path: '/add-blog', component: AddBlog },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router
